package com.notice.util;

import org.springframework.http.ResponseEntity;
import java.util.HashMap;
import java.util.Map;

public class ResponseUtil {
    public static ResponseEntity<?> success() {
        return ResponseEntity.ok().build();
    }

    public static ResponseEntity<?> success(Object data) {
        return ResponseEntity.ok(data);
    }

    public static ResponseEntity<?> error(int code, String message) {
        Map<String, Object> response = new HashMap<>();
        response.put("code", code);
        response.put("message", message);
        return ResponseEntity.status(code).body(response);
    }

    public static ResponseEntity<?> fail(String message) {
        return error(400, message);
    }
} 